package com.yunst.net.message;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author yunst
 * @date 2022/12/30
 */
public abstract class Message implements Serializable {
    /**
     * 消息类型
     *
     * @return
     */
    public abstract int getMessageType();

    public static final int imageMessage = 0;
    public static final int eventMessage = 1;


    private int len;
    private byte[] content;

    public int getLen() {
        return len;
    }

    public void setLen(int len) {
        this.len = len;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    private static final Map<Integer, Class<?>> messageClasses = new HashMap<>();

    static {
        messageClasses.put(imageMessage, ImageMessage.class);
        messageClasses.put(eventMessage, EventMessage.class);
    }


}
